package com.ebs.md.fxmonitor.server;

import java.util.List;

import com.ebs.commons.comp.IParsedPayload;
import com.ebs.commons.comp.ParsedPayload;
import com.ebs.md.fxmonitor.client.impl.GenericDealCodeSubscription;
import com.ebs.md.fxmonitor.topics.ClientTopicKeys;
import com.ebs.md.fxmonitor.topics.Keys;


/**
 * <p>Title: NetLink</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author ygrinberg
 * @version 1.0
 */
public class FxSubscriptionTest {

    private int m_arbTimestamp;
    private int m_timeOffset;
    private int m_arbMsgNum;
    private int m_arbSessionNum;
    private int m_sessionID;
    private List<GenericDealCodeSubscription> m_Subscribers;

    public FxSubscriptionTest() {
    }

    public void setArbTimestamp(int timestamp)
    {
        m_arbTimestamp = timestamp;
    }

    public int getOffsetTimestamp()
    {
        return m_timeOffset;
    }


    public void setOffsetTimestamp(int offset)
    {
        m_timeOffset = offset;
    }

    public int getArbTimestamp()
    {
        return m_arbTimestamp;
    }

    public void setArbSessionNum(int session)
    {
        m_arbSessionNum = session;
    }

    public int getArbSessionNum()
    {
        return m_arbSessionNum;
    }

    public void setArbMsgNum(int message)
    {
        m_arbMsgNum = message;
    }

    public int getArbMsgNum()
    {
        return m_arbMsgNum;
    }

    public void setSessionID(int session)
    {
        m_sessionID = session;
    }

    public void setSubscribers(List<GenericDealCodeSubscription> subscribers)
    {
        m_Subscribers = subscribers;
    }

    public List<GenericDealCodeSubscription> getSubscribers()
    {
        return m_Subscribers;
    }

    private IParsedPayload createSubscription()
    {
        ParsedPayload payload = new ParsedPayload();

        payload.addField(ClientTopicKeys.ArbMessageTime, getArbTimestamp());
        payload.addField(ClientTopicKeys.ArbSequenceNum, m_arbMsgNum);
        payload.addField(ClientTopicKeys.ArbSessionNum, m_arbSessionNum);
        payload.addField(ClientTopicKeys.SubscriptionId, m_sessionID);
        payload.addField(ClientTopicKeys.MessageType, Keys.MessageTypes.subscription.name());
        payload.addField(ClientTopicKeys.DealCodes, m_Subscribers);

        return payload;
    }



}
